home *** CD-ROM | disk | FTP | other *** search
/ Atari Mega Archive 1 / Atari Mega Archive - Volume 1.iso / mint / utils / stcron3.lzh / README < prev   
Encoding:
Text File  |  1993-10-09  |  8.0 KB  |  221 lines

  1. CRON; (c) Kees Lemmens, July 1993 ; Version 1.1
  2. -----------------------------------------------
  3.  
  4. This software may be redistributed in the Public Domain under the folllowing
  5. conditions :
  6.  
  7. - It may not be used for commercial purposes.
  8. - Distribution should always contain all files in this archive.
  9. - If you make any modifications, you're not allowed to redistribute these
  10.   modifications without my permission.
  11. - It may not be sold, unless it is for a nominal fee just to cover the dis-
  12.   tribution costs.
  13.  
  14. DISCLAIMER :
  15. ------------
  16.  
  17. - You're using this program completely at your own risk ! I am not worried
  18.   about big bugs in this cron, but I know the laws in the VS are absolutely
  19.   crazy about these matters. Thank God (and I tell you I'm a pure atheist)
  20.   we don't have such stupid laws here in Holland !
  21.  
  22. Well that was the official part !
  23.  
  24. VERSION 1.1: A few bugs fixed and new functionality added ; AT command
  25. VERSION 1.2: User and group id's now supported. Current dir is changed
  26.          to homedir before starting job.
  27.          SIGHUP mechanism abandoned because it didn't allow other
  28.          access than root (uid 0). It is replaced with a command
  29.          pipe.
  30.          Lockfile isn't created anymore, as the commandpipe can be
  31.          used in the same manner.
  32.  
  33. DESCRIPTION
  34. -----------
  35.  
  36. The CROND daemon runs on the background and is able to run many jobs
  37. at specified intervals. Job output is sent as mail to the user.
  38.  
  39. The CRONTAB and AT programs are used to supply new tasks to the CROND daemon.
  40.  
  41. Behaviour is similar to the UNIX cron , crontab and at commands.
  42.  
  43. CROND:
  44. ------
  45.  
  46. Reads all crontab files in CRONDIR (usually /usr/spool/cron/crontabs)
  47. and checks every minute by applying a bitmask from the current time
  48. +1 minute on the timemasks of the jobs in the joblist to see if there
  49. are jobs that should be started in the next minute.
  50.  
  51. If this is the case cron spawns these jobs with their output redirected
  52. to a temporary file in SPOOLDIR.
  53. It also checks every minute ( with the wait3 function ) to see if
  54. there are finished jobs. If so, it sends their output together with 
  55. the exit code as mail to the owner and then removes the temporary file.
  56.  
  57. System load could be less if we do not check every minute for the bit-
  58. masks and finished jobs, but it takes so little time (approx. 10-20
  59. milliseconds on my 16 MHz STE), that you virtually won't notice cron
  60. is running as long as there are no jobs to be started.
  61.  
  62. Default priority for all cron processes is -5 (NICELEVEL) so this also
  63. helps to prevent system overload.
  64.  
  65. The current shell is Mintshel. You can change this easily into KSH or TCSH
  66. but then every job wil take much more time and system load, because these
  67. shells are much bigger than Mintshel. I think it's better to start your
  68. own shell from the Mintshel only if you need its possibilities.
  69.  
  70. Remember the Mintshel can also start batchjobs with the extension .bat !!
  71.  
  72. Files/dirs necessary to run cron :
  73.  
  74. - SPOOLDIR      (/usr/spool/cron: used for output files)
  75. - CRONDIR       (/usr/spool/cron/crontabs: to store the crontabs)
  76. - ATDIR         (/usr/spool/cron/atjobs: to store at jobs)
  77. - /etc          (used for the crond.pid file)
  78. - /etc/passwd   (fron crontab to check if username exists)
  79. - /usr/mail     (this is where it puts the output from the cronjobs)
  80. - /bin/mintshel (in /bin : cron uses 'mintshel -c' to start jobs)
  81. - /bin/cat      (cat is used to append the job output to the mailfile)
  82.  
  83. Files that are created :
  84.  
  85. - /etc/syslog is automatically created if it doesn't exist. All messages
  86.   and errors will be written to this file. Change LOGFILE into something
  87.   else if you want your messages to go to the console or another logfile.
  88.  
  89. - /etc/crond.pid contains the process id of the running daemon. This is 
  90.   being read by the CRONTAB command to force a reread of the crontabs 
  91.   (by sending a SIGHUP signal) when something has changed.
  92.  
  93. - /usr/mail/<user> files to send output to the user.
  94.  
  95. It is best to start cron from your mint.cnf file, so it will run always
  96. in the background as soon as your machine starts up.
  97.  
  98. CRONTAB :
  99. ---------
  100.     
  101. This program is only a user interface to the CROND daemon that should
  102. run on the background of your ATARI to make things work.
  103.  
  104. Syntax:
  105.     crontab -l         : list existing crontab
  106.     crontab -r         : remove existing crontab
  107.     crontab <filename> : replace crontab with a new one
  108.  
  109. If your userid (LOGNAME) is not set, you can force a username with the
  110. -u <user> option.
  111.  
  112. Crontab does 3 things when creating a new crontab :
  113.  
  114. - It checks your new crontab for syntax errors.
  115. - It copies the new crontab to the crondir , which is often
  116.   /usr/spool/cron/crontabs.
  117. - It sends a rebuild signal to the cron daemon to make it reread
  118.   the crontables from disk.
  119.  
  120. Syntax of a crontab line :
  121.  
  122. <MIN> <HOUR> <DAY> <MONTH> <WEEKDAY> <SHELL COMMAND>
  123.  
  124. All timefields can be supplied in one of the following ways :
  125.  
  126. *              All possible values of this field are valid.
  127. <nr>[,<nr>,..] A number for every timevalue you want the command to be
  128.                executed.
  129. <from>-<to>    An interval for the times you want to the command to run.
  130.  
  131. Combinations are not allowed, so either *, or ..,.. or .-.. !!
  132.  
  133. Valid ranges :
  134.  
  135. MIN     : 0-59    HOUR    : 0-23    DAY     : 1-31
  136. MONTH   : 1-12    WEEKDAY : 0-6 (0=Sunday)
  137.  
  138. Shell commands can be supplied in UNIX format. They will automatically be 
  139. rewritten to TOS format. (/ changed into \)
  140.  
  141. Example :
  142.  
  143. 0 11 * * 3,6 /bin/mv -f /etc/syslog /etc/syslog.old
  144.  
  145. This entry will move the syslog file twice a week to syslog.old : Every
  146. Wednesday and Saturday at 11:00 AM.
  147.  
  148. AT:
  149. ---
  150.  
  151. This tool can start a job for one run in the background at a specified time.
  152. Behaviour is similar to the UNIX AT command, but the code was completely by
  153. myself.
  154.  
  155. Syntax:
  156.     at -l         : list existing at jobs
  157.     at -r <nr>    : remove at job <nr>
  158.     at <timespec> : submit a new at job (command is read from stdin)
  159.  
  160. There are 3 possibilities to specify the time :
  161.  
  162. - at now + 12minutes    at now + 3hours,
  163.   at now + 2 days    at now + 1 week
  164.  
  165.   As you see you can omit the space between the timevalue and type.
  166.   
  167. - at 12:30
  168.  
  169.   If the time is earlier than the current time the job will run
  170.   next day at the specified time.
  171.  
  172. - at 12:30 27-3
  173.  
  174.   If the time is earlier than the current time the job will run
  175.   next year at the specified time.
  176.   
  177. The shell command is read from stdin. Any CR, LF or Ctrl-D will finish
  178. the command and submit the job to the Crondaemon.
  179. In this way it is also possible to use a pipe and echo to specify the
  180. command (only from a shell !):
  181.   
  182.       echo '/bin/ls -la' | at now + 2days
  183.  
  184. Remark:
  185.  
  186. The only valid symbolic time is 'now'. So names like 'tomorrow', 'midnight'
  187. and others that can be used on some UNIX systems are not allowed.
  188.  
  189. ------------------------------------------------------------------------
  190.  
  191. CRON can be used to perform backups, to clear all kinds of log files, to 
  192. make your ATARI autmatically collect mail from a mailserver by telephone,
  193. to play a tune on your synthesizer every hour and everything else you can
  194. think off !
  195.  
  196. WARNINGS :
  197. ----------
  198.   
  199. - AT and CRONTAB programs can only run if the CROND daemon is running in
  200.   the background of your (MULTITOS) ATARI.
  201. - The files at.allow, at.deny, cron.allow and cron.deny are not implemented
  202.   as I consider this useless on a simple ATARI.
  203. - The programs need a passwd file to check the username (which is read
  204.   from LOGNAME env variable, uid or from the cmdline option -u <user>).
  205. - Combinations of intervals and comma separated values in the crontab time-
  206.   fields are not allowed !
  207. - You may only start TOS or TTP programs from the Mintshell !
  208. - The program doesn't know about crazy things like daylight savings time
  209.   and so: if you start your program on a non-existing hour it simply won't
  210.   run (presumed you adjusted the clock at the right time, which is of course
  211.   possible with cron !!)
  212.  
  213. Any remarks or suggestions about these programs can be send to:
  214. lemmens@dv.twi.tudelft.nl
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.